<?php
/**
 * Created By base
 * Author: Virus
 * Date: 2020/3/31
 * Time: 17:02
 */

namespace app\common\model\mysql;


use app\admin\lib\Curd;

class Ip extends BaseModel
{
    use Curd;

    /**
     * 状态获取器
     * @param $value
     * @return string
     */
    public function getStatusAttr($value)
    {
        return $value ? "<i class='fa fa-check-circle'></i>" : "<i class='fa fa-close'></i>";
    }

    /**
     * 取出多个字段，指定数组键值
     * @param array $where
     * @param $field
     * @param $key
     * @return array
     */
    public function getField($where = [], $field, $key)
    {
        return $this->where($where)->column($field, $key);
    }
}